Skip to main content

fillRule

Type

property

Summary

The fill rule to be used when rendering the SVG path.

Syntax

set the fillRule of <widget> to <pRule>
get the fillRule of <widget>

Description

Use the fillRule property to set the fill rule to be used for the widget. You may need to adjust it to ensure that paths that cross themselves, and paths that are made up of overlapping subpaths, are filled correctly.

The areas enclosed by the path are each filled or not filled depending on the fill rule used and the number of times the path loops around them. When the path goes around a region clockwise, it adds 1 to number of encirclements. When it goes around a region anticlockwise, it subtracs 1 from the number of encirclements.

See https://www.w3.org/TR/SVG/painting.html#FillRuleProperty for examples of the "non-zero" and "even odd" fill rules.

Parameters

NameTypeDescription

pRule

The fill rule to be used.

  • "non-zero": Fill regions encircled at least once by the path.
  • "even odd": Fill regions encircled an even number of times by the path.